/**
 * @desc
 *
 * @使用场景
 *
 * @author  杨晓东[of1081]
 * @company qianmi.com
 * @Date    16/4/9
 **/
'use strict';

export default class configOrderUtil{


    /**
     * 从配置信息中递归找出组件配置信息
     * @param widgetInfo
     * @returns {Array}
     */
    static extraNameSpaces (configOrder){

        if(!configOrder){
            return [];
        }
        let widgetInfo =configOrder;
        let ns =[];

        if(widgetInfo.widgetNameSpace){
            ns.push(widgetInfo.widgetNameSpace);
        }

        if( widgetInfo.children){
            widgetInfo.children.forEach(childrenItem=>{
                ns= ns.concat(configOrderUtil.extraNameSpaces(childrenItem));
            });
        }

        return ns;
    }

}